The Ring-LWE Problem in Lattice-Based Cryptography: The Case of Twisted Embeddings

Several works have characterized weak instances of the Ring-LWE problem by exploring vulnerabilities arising from the use of algebraic structures. Although these weak instances are not addressed by worst-case hardness theorems, enabling other ring instantiations enlarges the scope of possible applications and favors the diversification of security assumptions. In this work, we extend the Ring-LWE problem in lattice-based cryptography to include algebraic lattices, realized through twisted embeddings. We define the class of problems Twisted Ring-LWE, which replaces the canonical embedding by an extended form. By doing so, we allow the Ring-LWE problem to be used over maximal real subfields of cyclotomic number fields. We prove that Twisted Ring-LWE is secure by providing a security reduction from Ring-LWE to Twisted Ring-LWE in both search and decision forms. It is also shown that the twist factor does not affect the asymptotic approximation factors in the worst-case to average-case reductions. Thus, Twisted Ring-LWE maintains the consolidated hardness guarantee of Ring-LWE and increases the existing scope of algebraic lattices that can be considered for cryptographic applications. Additionally, we expand on the results of Ducas and Durmus (Public-Key Cryptography, 2012) on spherical Gaussian distributions to the proposed class of lattices under certain restrictions. As a result, sampling from a spherical Gaussian distribution can be done directly in the respective number field while maintaining its format and standard deviation when seen in Zn via twisted embeddings.


Introduction
Lattice-based cryptography comprehends the class of cryptosystems whose security is based on the conjectured intractability of hard lattice problems such as the Shortest Independent Vectors Problem (SIVP), the Shortest Vector Problem (SVP), and the Closest Vector Problem (CVP) [1,2]. The main computational problem in the foundation of most modern lattice-based cryptosystems is Learning with Errors (LWE) [3]. Since its introduction in the cryptographic realm in 2005, algebraically structured variants have been proposed, such as Learning with Errors over Rings [4], denoted Ring-LWE, and Module-LWE [5][6][7], among others [8].
Although the Ring-LWE hardness results hold for any number field [4,9], its most used instantiation in lattice-based cryptosystems is over power-of-two cyclotomic number fields, as evidenced by the finalists of NIST's Post-Quantum Cryptography standardization effort [10]. This choice of a number field is particularly interesting because its ring of integers is isomorphic to the polynomial ring R = Z[x]/(x n + 1), for n a power of two. The fact that x n + 1 is maximally sparse allows efficient polynomial multiplication using the number-theoretic transform combined with the negacyclic convolution. In addition to that, the transformation from the ring R to its dual, denoted R ∨ , is a simple scaling of the form R = mR ∨ , allowing applications to work directly on R, with no loss in their underlying worst-case hardness guarantees [4].
Another advantage of power-of-two cyclotomic number fields is that the sampling of error terms can be performed directly in the ring R considering a power basis, since the transformation to the associated vector subspace H isomorphic to R n is just a rigid rotation followed by scaling. For other choices of cyclotomic fields, sampling from a spherical Gaussian distribution can be done in an extended ring and performing a reduction modulo the cyclotomic polynomial Φ m (x), which leads to the desired spherical distribution in the canonical embedding [11]. For general number fields, the best option in terms of security still is a sampling from an error distribution in H and computing the inverse transformation with respect to the canonical embedding [4,12].
There are several works in the literature exploring properties of number fields used in the foundation of some cryptosystems based on ideal lattices. An example is a quantum polynomial-time algorithm to find a small generator of a principal ideal in the ring of algebraic integers of cyclotomic rings [13], which applies to a few schemes including the fully-homomorphic encryption scheme of Smart and Vercauteren [14]. Moreover, a sequence of works has characterized weak instances of Ring-LWE and Poly-LWE problems and proposed attacks using special properties for specific parameters [15][16][17][18][19][20][21][22][23][24]. Another motivation for searching for alternative number fields is the inflexibility of system parameters that grow as a power-of-two. In such cryptosystems, when it is required to increase the security level, it may be necessary to increase the lattice dimension which implies doubling its size. However, a more suitable dimension could be a value much smaller than the next power of two. In fact, a ring dimension ranging from 700 to 800 suffices for 128-bit security [25].
Although these weak instances are not addressed by worst-case hardness theorems [26], new proposals adopting non-conventional rings have emerged as alternatives, thus favoring the diversification of security assumptions. For NTRU-based schemes, examples are the NTTRU [27], the third-round NTRU submission [28] in the NIST Post-Quantum Cryptography contest [10], and NTRU Prime [29]. For Ring-LWE, the instantiations have been restricted to cyclotomic number fields. Lyubashevsky, Peikert, and Regev introduced a toolkit with techniques for secure implementation of Ring-LWE primitives over any cyclotomic number field [12], allowing applications to work on cyclotomic rings with nonpower-of-two dimension. Later on, this toolkit was implemented in software in two distinct libraries [30,31]. An alternative instantiation could be the adoption of the polynomial ring Z[x]/(x p − x − 1) for p prime, which was proposed for NTRU Prime [29], and suggested for the Ring-LWE setting [32]. In this sense, we conjecture whether the Ring-LWE problem could be parameterized by number fields other than the cyclotomic for cryptographic applications.

Contributions
In this context, we extend the Ring-LWE class of problems to embrace more general algebraic constructions of lattices which allow additional factors on the embedding coordinates. We replace the canonical embedding by twisted embeddings. Since the canonical embedding is a special case of twisted embeddings, this replacement maintains the consolidated results for Ring-LWE. Twisted embeddings have been useful in coding theory, since they allow the construction of algebraic lattices with improved properties for Rayleigh fading channels, providing high density, maximum diversity, and great minimum product distance [33][34][35].
We extend the Ring-LWE problem by replacing the canonical embedding with twisted embeddings on both the search and decision variants. As a result, we obtain the Twisted Ring-LWE problem, in which the error terms are sampled in the space H isomorphic to R n under the inner product induced by a twisted embedding. We show that Twisted Ring-LWE is at least as secure as Ring-LWE through a security reduction from Ring-LWE to Twisted Ring-LWE. We also recomputed the approximation factors in the worst-case to average-case reductions from hard lattice problems taking into account the new twist factor.
As a result, algebraic constructions from coding theory via twisted embeddings can also be used in cryptographic applications based on the Ring-LWE problem. In this work, we focused our attention on the algebraic construction of rotated Z n -lattices via twisted embeddings. Ducas and Durmus [11] showed that a spherical Gaussian distribution in the corresponds to a distribution with the same format in the space H, but linearly wider in the ring dimension. This occurs because the lattice obtained from the ring Q[x]/(Θ m (x)) is a rotated Z n -lattice in the canonical embedding. The same holds for the ring of integers of a power-of-two cyclotomic number field. Thus, we generalize this result of Ducas and Durmus by showing that if the parameter ring leads to a rotated Z n -lattice under twisted embeddings, then both the format and the standard deviation of a spherical Gaussian distribution in K R is preserved when seen in H. Examples of ideal lattices equivalent to Z n are those obtained from power-of-two cyclotomic number fields [36], and their maximal real subfields [37], and the maximal real subfields of p-th cyclotomic number fields. Since power-of-two cyclotomic rings have been widely used in cryptographic applications, we consider parameterizing the Ring-LWE problem with the ring of integers of the maximal real subfield of a cyclotomic number field. We discuss the limitations of using maximal real subfields in a public-key encryption scheme [12] using the polynomial representation in terms of the arithmetic operations and the expansion factor of the defining polynomial. However, we argue that these limitations could be circumvented by using the coefficient vector representation, as done in [12]. Finally, we also argue that twisted embeddings can be used as a tool to connect Ring-LWE instances over distinct rings, which may lead to a response to the open question left by Peikert, Regev, and Stephens-Davidowitz [9]. In fact, if the parameter rings generate the same algebraic lattice in the space H, their Ring-LWE instances can be efficiently converted between themselves.

Organization
This paper is organized as follows. Section 2 is devoted to the introduction of concepts and results on lattices and algebraic number theory to be used throughout the paper. In particular, Section 2.4 presents the original statement of the Ring-LWE problem in its search and decision variants, and also the computational problems which form the foundation of the (Ring)-LWE hardness. Section 3 introduces the twisted embeddings and generalizes the class of Ring-LWE problems by adopting twisted embeddings. We prove that multiplying the coordinates of vectors in the canonical representation by a twisting factor does not affect the hardness of Ring-LWE. This is shown via a reduction from both search and decision versions of Ring-LWE to their corresponding twisted forms. Moreover, we compute the new approximation factors for the reduction from SIVP to DGS (Discrete Gaussian Sampling problem), and also for the reduction from DGS to Ring-LWE. Since the new approximation factors are simply multiplied by a scalar associated with the lattice dimension n, the asymptotic factors are not affected by the change of embeddings.
Section 4 extends to a more general class of number fields the results of Ducas and Durmus on spherical Gaussian sampling [11]. We show that correct noise sampling can be performed directly in the field representation of lattices equivalent to Z n without any increase in the standard deviation. Section 4.1 discusses the practical impacts of instantiating the Ring-LWE problem over the ring of integers of the maximal real cyclotomic number field Q(ζ p + ζ −1 p ), where p ≥ 5 is a prime number. We analyze the main computational operations in the compact public-key cryptosystem of Lyubashevsky, Peikert, and Regev [12], and also the format of the ring's defining polynomial in terms of the expansion factor. Finally, Section 5 discuss our results and highlight future research directions on the practical aspects of the Twisted Ring-LWE problem.

Preliminaries on Lattices and Algebraic Number Theory
In this section, we introduce concepts, results and notation to be used throughout the paper. For a positive integer number m, denote by [m] the set {1, 2, . . . , m}. For 1 ≤ p < ∞, the p -norm of a vector a in R n or C n is a p = (∑ n i=1 |a i | p ) 1/p , and the ∞ -norm is a ∞ = max i∈[n] |a i |.

The Space H
Frequently, lattices are defined in the Euclidean space R n . However, in the Ring-LWE context [4,9], it is more convenient to define lattices in a specific subspace of C n isometric to R n : the space H. Definition 1 (Space H). Let s 1 and s 2 be non-negative integer numbers such that n = s 1 + 2s 2 > 0.
We consider H endowed with the inner product obtained as a restriction of the standard inner product of C n : a j+s 1 b j+s 1 +s 2 + a j+s 1 +s 2 b j+s 1 ∈ R.
The norm (usually 2 -norm) of a = (a 1 , a 2 , . . . , a n ) ∈ H is defined as a = a, a H . For i ∈ [n], denote by u i the vector with all zero coordinates except for the i-th position, which is equal to one. We consider {u 1 , u 2 , . . . , u n } the canonical basis of R n (over R) and C n (over C). An orthonormal basis for H can be defined in terms of the canonical basis of C n : Definition 2 (Canonical basis of H). Let s 1 and s 2 be non-negative integer numbers such that n = s 1 + 2s 2 u i+s 1 + u i+s 1 +s 2 and h i+s 1 +s 2 = i √ 2 (u i+s 1 − u i+s 1 +s 2 ). Then, the set B = {h 1 , h 2 , . . . , h n } is an orthonormal basis of H, which we call the canonical basis of H as an n-dimensional R-vector space.
Notice that any vector a = (a 1 , a 2 , . . . , a n ) ∈ H ⊆ C n can be written as an R-linear combination of the vectors of the canonical basis B of H as where (·) and (·) denote the real and imaginary parts of a complex number, respectively. The linear map κ ∑ i∈[n] b i h i := ∑ i∈[n] b i u i , with b i ∈ R, defines an isomorphism between the R-vector spaces H and R n , such that a, b H = κ(a), κ(b) , where ·, · denotes the standard inner product in R n . Then, it follows that H and R n are isometric, that is, H is an Euclidean space, as defined next. In particular, the norm of an element a ∈ H coincides with the usual norm ( 2 -norm) of κ(a) ∈ R n , that is, a = κ(a) 2 .

Lattices in Euclidean Vector Spaces
An Euclidean vector space (E, ·, · E ) is an n-dimensional R-vector space E with an inner product ·, · E , which is isometric to R n with the standard inner product. Consider an orthonormal basis B(E) = {e 1 , e 2 , . . . , e n } of E.
A set Λ ⊂ E is said to be a full-rank lattice (or simply lattice), if Λ is a discrete additive subgroup of E with rank n. Equivalently, Λ ⊂ E is a lattice if there exists a set of linearly independent vectors B = {v 1 , v 2 , . . . , v n } ⊂ E such that The set B is called a basis (or a Z-basis) of Λ. For each v j ∈ B, it can be written in terms of the orthonormal basis B(E) as v j = ∑ i∈[n] v ij e i for v ij ∈ R.
The minimum distance of a lattice Λ in the p -norm, denoted λ (p) 1 (Λ), is the length of a shortest nonzero lattice vector, that is, λ Similarly, for any k ≤ n, the k-th successive minimum of a lattice Λ, denoted λ The dual lattice of Λ is the lattice Λ * = {a ∈ E : a, b E ∈ Z, ∀ b ∈ Λ} and has generator matrix (M t ) −1 . It is known that (Λ * ) * = Λ and if Λ has generator matrix M, then (M t ) −1 is a generator matrix for Λ * and therefore det( Equivalently, Λ is an integral lattice if and only if Λ ⊂ Λ * ⊂ (Λ/ det(Λ)). An integral lattice is called unimodular, or self-dual, if det(Λ) = 1 or, equivalently, if Λ = Λ * .
Two lattices Λ and Λ are said to be equivalent if one can be obtained from the other through a rotation, a reflection, or a change of scale. We denote this equivalence by Λ Λ . Two Gram matrices G and G of two equivalent lattices Λ and Λ , respectively, are related as G = c 2 U t GU, where c = 0 is a real constant and U is unimodular.
We say that a lattice Λ in (E, ·, · E ) is orthogonal if it has a basis B = {v 1 , v 2 , . . . , v n } such that v i , v j = 0 if i = j, for all i, j ∈ [n]. This means that Λ has a diagonal Gram matrix. Moreover, if the basis B satisfies v i , v j = 0 if i = j and v i , v j = c if i = j, for all i, j ∈ [n] and c ∈ R, then Λ is equivalent to the Z n -lattice. In this case, Λ has a Gram matrix G = c Id n . In particular, when c = 1, we say that Λ is an orthonormal lattice.

Gaussian Measures
For r > 0, define the Gaussian function ρ r,c : H → (0, 1] centered at c as The subscript c is taken to be 0 when omitted. By normalizing this function, we obtain the continuous Gaussian probability distribution D r of width r, whose density is given by r −n · ρ r (x). We extend this definition to elliptical Gaussian distributions in {h i } i∈[n] (the canonical basis of H) as follows. Let r = (r 1 , . . . , r n ) ∈ (R + ) n be a vector of positive real numbers such that r j+s 1 +s 2 = r j+s 1 for each j ∈ [s 2 ]. Then, a sample from the n-dimensional distribution D r is given by ∑ i∈ [n] x i h i , where the x i are chosen independently from the (one-dimensional) Gaussian distribution D r i over R.
The smoothing parameter is a lattice parameter defining the width beyond which a discrete Gaussian starts to behave similarly to a continuous distribution [38]. It is related to the minimum distance and the successive minimum of a lattice and it will be used to derive the approximation factors in the worst-case to average-case reduction for to the Twisted Ring-LWE problem. The Gaussian mass of a coset c + Λ is defined as ρ r (c + Λ) = ∑ x∈c+Λ ρ r (x).

Definition 3 (Smoothing parameter).
For an n-dimensional lattice Λ and positive real > 0, the smoothing parameter η (Λ) is the smallest r such that For any c ∈ R n , real r > 0, and an arbitrary lattice Λ with dimension n, normalizing the Gaussian function ρ r,c (a) gives the discrete Gaussian distribution over Λ as for all a ∈ Λ.

Algebraic Number Theory
In this section, we summarize concepts and results from algebraic number theory, presenting as an example the case of cyclotomic number fields and their maximal real subfields. Details can be found in [39,40].
An (algebraic) number field K is a finite extension of the field Q. This means that Q ⊂ K and K is a Q-vector space with finite dimension. The degree of K, denoted [K : Q], is the dimension of the Q-vector space K. In general, if K and L are number fields such that K ⊂ L, the symbol [L : K] is defined to be the integer number [L : Q]/[K : Q] and is called the degree of the extension L/K.
By the Primitive Element Theorem, there exists an element θ ∈ K such that K = Q(θ), which is equivalent to say that {1, θ, θ 2 , . . . , θ n−1 }, with n = [K : Q], is a power basis of K over Q. Also, if p(x) is the minimal polynomial of θ over Q, then K is isomorphic to Q[x]/(p(x)) and K = Q(θ ) for some root θ of p(x). The roots of p(x) are called the conjugates of θ.
Example 1 (Cyclotomic number field). A number field of particular interest is Q(ζ m ), the m-th cyclotomic field, where ζ m = exp(2πi/m) is a primitive m-th root of unity for any integer is the maximal real subfield of Q(ζ m ) and has degree ϕ(m)/2.
Let K be a number field. A map¯: m is the same involution given by the complex conjugation. In this work, whenever the cyclotomic number field is used, we implicitly assume this involution. For the maximal real subfield Q(ζ m + ζ −1 m ), we consider the involution given by the identity map. The subfield F = {a ∈ K | a = a}, called the fixed field by involution of K, satisfies [K : F] ≤ 2. When [K : F] = 1 (or F = K), we say that the involution is trivial (it is the identity); otherwise, the involution is said to be non-trivial. If K = Q(ζ m ), the fixed field by the involution ζ m = ζ −1 m of K is its maximal real subfield [36].

Field Monomorphisms
Let K be a number field of degree n. There are exactly n distinct monomorphisms (of fields) from K to C. These monomorphisms are Q-monomorphisms. If K = Q(θ) and p(x) is the minimal polynomial of θ, these monomorphisms can be defined as σ i (θ) = θ i for i ∈ [n], where θ i are all the distinct roots of p(x).
Otherwise, it is said to be complex. If σ i is a complex monomorphism, then σ i is another complex monomorphism defined by σ i (a) = σ i (a). So, we can write the degree n as n = s 1 + 2s 2 , where s 1 ≥ 0 is the number of real monomorphisms and 2s 2 ≥ 0 is the number of complex monomorphisms from K to C. The canonical embedding from K into the subspace H is the homomorphism σ(a) = (σ 1 (a), σ 2 (a), . . . , σ n (a)).
Its image is a lattice, used in the Ring-LWE problem [4,9].
The pair (s 1 , s 2 ) is called the signature of K. We say that K is totally real when s 2 = 0, and that K is totally complex when s 1 = 0. The number field K is said to be a CM-field if it is totally complex and has degree two over its fixed field by the involution F [36].
Any cyclotomic number field K = Q(ζ m ), with m ≥ 3, is totally complex. Their monomorphisms are defined as . The number field K is said to be a Galois number field if, for every x ∈ K, the minimal polynomial of x over Q has all its roots in K. In this case, the set of automorphisms σ : K → K, where σ(a) = a for all a ∈ Q, constitutes a group under the composition, called Galois group of K over Q and denoted by Gal(K/Q). If K ⊂ C is a Galois number field, then the monomorphisms from K to C are exactly the elements of Gal(K/Q). An important fact is that any Galois number field is totally real or totally complex. Cyclotomic number fields and their maximal real subfields are Galois number fields. Specifically, the set

Ring of Integers and Its Ideals
Let K be a Galois number field. For every a ∈ K, the trace and norm of any element a ∈ K can be defined, respectively, as and For all a ∈ K, Tr K (a) and N K (a) are elements of Q.
The set of all elements in a number field K that are the root of a monic polynomial in Z[x] is a ring called the ring of integers of K, denoted by O K . If K is a number field of degree n, its ring of integers has a Z-basis with n elements, which is called an integral basis of K. If a ∈ O K , then Tr K (a) and N K (a) are elements of Z.
If I is a nonzero (integral) ideal of O K , then I has a Z-basis with n elements. The same holds if I is a fractional ideal of K, which is a subset of K satisfying the condition that dI ⊂ O K is an integral ideal for some element d ∈ O K . Note that every integral ideal is also fractional (d = 1). Also, any Z-basis of some nonzero fractional ideal of K, including its ring of integers, is a Q-basis of K.
In general, the ring of integers of a number field K = Q(θ) does not have the form Z[θ]. When this is the case, we say that K is a monogenic number field.
The fractional ideal D −1 K = {a ∈ K : Tr K (aO K ) ⊂ Z} is the codifferent ideal, that is, the dual ideal of the ring of integers. Frequently, the codifferent ideal is also denoted by O ∨ K . [41] (Section 13.2, J). The inverse ideal of the codifferent, that is, In general, the dual ideal of any fractional ideal I of K is the fractional ideal I ∨ of K, defined as If I is a nonzero fractional ideal of O K , the norm of I is N(I ) = |O K /I | (the cardinality of the quotient of additive groups). If I and J are ideals of O K , then N(I J ) = N(I )N(J ), where IJ denotes the product of I and J , that is, the set all finite sums of products ab for a ∈ I and b ∈ J . If I is a principal ideal generated by some a ∈ K, then N(I ) = | N K (a)|.

The Ring-LWE Problem
In the following definitions, a lattice Λ is usually represented by a basis B and, in the context of algebraic lattices, Λ can be seen as a fractional ideal I of an arbitrary number field K via canonical embedding.
Firstly, we define the computational problems which form the foundation of the (Ring)-LWE hardness, namely the decision version of the Shortest Vector Problem (GapSVP), the Shortest Independent Vectors Problem (SIVP), and the Discrete Gaussian Sampling (DGS) problem, which is denoted K-DGS when the underlying lattice is taken over a number field K [4].
By seeing a fractional ideal I of an arbitrary number field K as a lattice using the canonical embedding, let D I,r denote the discrete Gaussian distribution of width r over I in the field tensor product K R = K ⊗ Q R, which is isomorphic to the space H.
Definition 6 (K-DGS γ ). For a function γ that maps lattices to nonnegative reals, the K-DGS γ problem is: given an ideal I in K and a parameter r ≥ γ = γ(I ), output an independent sample from a distribution that is within negligible distance of D I,r .
Alternatively, for the purpose of the worst-case to average-case reduction for (Ring-)LWE, the DGS problem can be stated as follows: given an n-dimensional lattice Λ and a number r ≥ √ 2n · η (Λ)/α, output a sample from D Λ,r . In order to define the Ring-LWE distribution and the computational problems associated with it, let K be a number field with ring of integers R = O K . Recall that R ∨ is the (fractional) codifferent ideal of K, and let T = K R /R ∨ . Let q ≥ 2 be a (rational) integer modulus and, for any fractional ideal I of K, let I q = I/qI.

Definition 7 ([4]
Ring-LWE distribution). For s ∈ R ∨ q (the "secret") and an error distribution ψ over K R , a sample from the Ring-LWE distribution A s,ψ over R q × T is generated by choosing a ← R q uniformly at random, choosing e ← ψ, and outputting (a, b = (a · s)/q + e mod R ∨ ).

Definition 8 ([4]
Ring-LWE, search). Let Ψ be a family of distributions over K R . The search version of the Ring-LWE problem, denoted R-LWE q,Ψ , is defined as follows: given access to arbitrarily many independent samples from A s,ψ , for some arbitrary s ∈ R ∨ q and ψ ∈ Ψ, find s. 4,9] Ring-LWE, average-case decision). Let Υ be a distribution over a family of error distributions, each over K R . The average-case Ring-LWE decision problem, denoted R-LWE q,Υ , is to distinguish (with non-negligible advantage) between independent samples from A s,ψ for a random choice of (s, ψ) ← U(R ∨ q ) × Υ, and the same number of uniformly random and independent samples from R q × T.

The Twisted Ring-LWE
Firstly, we collect important results on algebraic lattices obtained through twisted embeddings. Then, we present the class of problems Twisted Ring-LWE, which is the main contribution of this work. The hardness of Twisted Ring-LWE is demonstrated by security reductions from the original Ring-LWE problem. Also, we recompute the approximation factors in the worst-case to average reduction from the SIVP problem, considering the twist factor defining the twisted embedding.

Twisted Embeddings
In this section consider the following setting. Let K be an algebraic number field with degree n, signature (s 1 , s 2 ), and¯a fixed involution. Consider F to be the fixed field by the involution of K. Let σ i be the real monomorphisms for i ∈ [s 1 ], and σ i+s 1 be the complex monomorphisms for i ∈ [2s 2 ] from K to C, where σ i+s 1 +s 2 = σ i+s 1 for all i ∈ [s 2 ]. The twisted embeddings defined next are a generalization of the canonical embedding [36]. An element τ ∈ K is said to be totally positive if τ ∈ F and τ i = σ i (τ) is a positive real number for all i ∈ [n].
Since τ = 1 in F is totally positive, then σ 1 = σ, which means that twisted embeddings are generalizations of the canonical embedding. Twisted embeddings provide a way to obtain a variety of lattices in H R n in addition to the ones obtained via canonical embedding, as a consequence of Proposition 1 [36].

Proposition 1 ([36]
). If M is a free Z-module of rank n in K (particularly, if M is the ring of integers of K or any fractional ideal of K), then σ τ (M) is a full-rank lattice in H.
Twisted embeddings can be extended from K to K R as follows. For any totally positive element τ ∈ F, the R-vector space σ τ (K R ) is isomorphic to H R n . If B is a Q-basis of the number field K, then B is an R-basis of K R . So, for all totally positive τ ∈ F, σ τ (B) is an R-basis of H.
Consider the natural extension of the trace function Tr K : K → Q to Tr K : K R → R. For any totally positive τ ∈ F, we can define an inner product in K R as By considering the inner product ·, · τ , the R-vector space K R is an Euclidean vector space of dimension n isometric to both (H, ·, · H ) and (R n , ·, · ). For each a ∈ K R , the p -norms of a under the canonical embedding are simply a p = σ(a) p = ∑ i∈[n] |σ i (a)| p 1/p for p < ∞, and max i∈[n] |σ i (a)| for p = ∞. Similarly, the p -norms induced from C n under twisted embeddings are defined as where τ i = σ i (τ) for a totally positive element τ ∈ F. Thus, any free Z-module M of rank n can be seen as a full-rank lattice directly in the Euclidean vector space (K R , ·, · τ ), although the image of σ τ (M) is frequently considered as in (H, ·, · H ). Using the fact that σ τ (a · b) = σ(a) σ τ (b) = σ τ (a) σ(b) for any a, b ∈ K R , where is the component-wise multiplication in the space H, it follows that Notice that, since multiplication of elements in K R is mapped to coordinate-wise multiplication in H, we have that for any element a ∈ K R , the distribution of a · D r is . Because of the induced norms from C, which maps elements of K to H, an elliptical distribution defined in the space H can be seen as a distribution directly over K R . For practical applications, sampling from an error distribution in K R is done by generating the error in H and mapping it to its corresponding element in K R , via twisted embeddings. However, in some special cases, an error can be efficiently sampled directly in K R without requiring the computation of the inverse of the Vandermonde matrix with respect to σ τ [11].
Since K R R n under twisted embeddings, it follows that K R admits an orthonormal basis. Thus, for any Z-basis It should be clear that, for different totally positive elements, the lattices obtained from M may not be equivalent, as can be seen below.
For example, for τ = 1 and τ = 2 + √ 3, the Gram matrices are given by: Suppose that these two lattices are equivalent. Then, there exists a square matrix U with integer entries and determinant ±1, and a real number k = 0 such that G 2+ Since the determinant of both matrices in (5) is equal to 12, then k = ±1. Now, consider U to be a matrix for which the rows are given by the vectors (a, b) ∈ Z 2 and (c, d) ∈ Z 2 . So, the system of equations G 2+ √ 3 = U t G 1 U has no solution (a, b, c, d) ∈ Z 4 because the equation 2 = a 2 + 3c 2 , provided by the first entry, has no solution (a, c) ∈ Z 2 . This gives a contradiction. Therefore, the lattices given by the same module M = O K in the two different inner product spaces (K R , ·, · 1 ) and (K R , ·, · 2+ √ 3 ) are not equivalent.
Any full-rank lattice M in (K R , ·, · τ ) is said to be an algebraic lattice. If M = I is a fractional ideal in K and the lattice I is integral (that is, a, b τ ∈ Z for all a, b ∈ I), then I can be called an ideal lattice in (K R , ·, · τ ). Since a, b τ = Tr K (τab), an ideal I of K constitutes an ideal lattice in (K R , ·, · τ ) if and only if τI I ⊂ D −1 K (= O ∨ K ). Ideal lattices can be obtained if and only if K is either a totally real number field or a CM-field. In particular, ideal lattices can be obtained via cyclotomic number fields and their maximal real subfields.
Let I be a fractional ideal of K. It is known that σ(I ∨ ) = σ(I ) * in H under the canonical embedding. However, the same does not hold for twisted embeddings in general, as can be inferred from Proposition 2.

Proposition 2.
Let τ ∈ F be a totally positive element and let I a fractional ideal of K. Then, in the Euclidean vector space (K R , ·, · τ ), it follows that:

The Twisted Ring-LWE Problem
In this section, we propose an extended version of the Ring-LWE problem, adopting twisted embeddings rather than the canonical embedding. We refer to this new class of problems as Twisted Ring-LWE, or simply Ring-LWE τ . We also prove that solving the Twisted Ring-LWE problem is at least as hard as solving the original Ring-LWE problem [4], providing a polynomial-time reduction from Ring-LWE to Twisted Ring-LWE.
In the Ring-LWE distribution, the error e is randomized by a distribution ψ over the space (K R , ·, · τ=1 ). In this sense, an error in K R can be seen as the inverse image of a sample from the distribution ψ in H R n via the canonical embedding. In our general case, we consider K a number field with an involution, F its associated fixed field, τ ∈ F a totally positive element, and σ τ the twisted embedding. The error e is randomized by a distribution ψ over (K R , ·, · τ ). In the following, it is assumed q ≥ 2 is an integer number, R := O K , and I q := I/qI for any fractional ideal I of K.
Definition 11 (Twisted Ring-LWE distribution). For a totally positive element τ ∈ F, let ψ τ denote an error distribution over the inner product ·, · τ and s ∈ R ∨ q (the "secret") be an uniformly randomized element. The Twisted Ring-LWE distribution A s,ψ τ produces samples of the form where a is uniformly randomized in R q and the error e is randomized by ψ τ in (K R , ·, · τ ).
Analogously to Ring-LWE [4], which is defined in the space K R provided with the inner product associated to the canonical embedding, we can define both search and decision problems in the space (K R , ·, · τ ) as follows. We strictly follow the search problem as defined by Lyubashevsky et al. [4] and the decision problem which was further defined by Peikert et al. [9].  ≤α is the set of all elliptical Gaussian distributions D r over (K R , ·, · τ ), where each parameter r i ≤ α.
Definition 13 (Ring-LWE τ , search). Let Ψ (τ) be a family of distributions over the inner product space (K R , ·, · τ ). The search version of the Ring-LWE τ problem is defined as follows: given access to arbitrarily many independent samples from A s,ψ τ for some arbitrary s ∈ R ∨ q and ψ τ ∈ Ψ (τ) , find s.
Definition 15 (Ring-LWE τ , average-case decision). Let Υ (τ) be a distribution over a family of error distributions, each in the inner product space (K R , ·, · τ ). The average-case decision version of the Ring-LWE τ problem is to distinguish, with non-negligible advantage, between arbitrarily many independent samples from A s,ψ τ , for a random choice of (s, ψ τ ) ← U(R ∨ q ) × Υ (τ) , and the same number of uniformly random and independent samples from R q × K R /R ∨ .
Generally speaking, the Twisted Ring-LWE distribution and both search and decision variants of Twisted Ring-LWE collapse to their original definitions in the Ring-LWE problem when τ = 1.

Hardness of Twisted Ring-LWE
In this section we provide evidence of the hardness of the Ring-LWE τ class of problems. Firstly, we provide reductions from the Ring-LWE problem to the Ring-LWE τ problem. By doing so, the Ring-LWE τ problem is proven to be at least as hard as NP-hard lattice problems. It occurs that these are indeed self reductions, in the sense that they preserve the secret term s ∈ R ∨ q , only distorting the error distribution over K R . We recall that the reduction to the search version of Ring-LWE is defined over a set of elliptical Gaussian distributions over K R (Definition 12). Theorem 1. Let K be an arbitrary number field and τ ∈ F be totally positive. Let (s, ψ) be randomly chosen from (U(R ∨ q ) × Ψ) in (K R , ·, · τ=1 ). Then there is a polynomial-time reduction from Ring-LWE q,ψ to Ring-LWE τ q,ψ τ .
Proof. We assume the existence of an oracle for Ring-LWE τ that, given a set of independent samples from A s,ψ τ , for some arbitrary s ∈ R ∨ q and ψ τ ∈ Ψ (τ) , recovers the secret term s. Given a set of independent samples from the Ring-LWE distribution A s,ψ , solving the search version of Ring-LWE amounts to finding the secret s. In order to evoke the Ring-LWE τ oracle to solve Ring-LWE, we must ensure that the error terms from the input samples follow a Gaussian distribution ψ τ ∈ Ψ (τ) . Let the input samples from A s,ψ be represented as where e i ψ ← − K R . Thus, we use the fact that e i = σ −1 (ẽ i ), for someẽ i obtained from the Gaussian distribution ψ over H. The Ring-LWE τ samples are obtained by first computing the corresponding representatives of each pair (a i , b i ) in H as By applying the inverse transformation σ −1 τ , we obtain that Notice that s was unchanged by the transformations, so it is a randomized element over R ∨ q . Because a i was sampled according to a uniform distribution over R q and both σ and σ −1 τ transformations are injective, σ −1 τ (σ(a i )) is also uniform in R q . And, finally, since , the set of samples in (7) follows the distribution A s,ψ τ . Given the set of samples (7) as input for the Ring-LWE τ solver, it finds the secret s. Then, mapping the solution to the Ring-LWE instance of the Ring-LWE τ solution is done by the identity transformation. Since the computation of the transformations σ and σ −1 τ can be seen as vector-matrix multiplications, the reduction costs O(n 2 ) operations. Thus, the given reduction from Ring-LWE to Ring-LWE τ runs in polynomial time. This concludes the proof. Theorem 2. Let K be an arbitrary number field and τ ∈ F be a totally positive element. Let (s, ψ) be randomly chosen from (U(R ∨ q ) × Υ) in (K R , ·, · τ=1 ). There is a polynomial-time reduction from Ring-LWE q,Υ to Ring-LWE τ q,Υ (τ) .
Proof. Given a set of m pairs of the form (a i , b i ) ∈ R q × T, each drawn either from A s,ψ or from a uniform distribution over R q × T, we prove that the (decision) Ring-LWE problem can be solved using only an oracle for (decision) Ring-LWE τ and a polynomial-time function for mapping the input instances. As in the reduction for the search variant, we apply the transformations σ and σ −1 τ , in this order, to each pair (a i , b i ) ∈ R q × T. As a result, those pairs drawn from (U(R q ), U(T)) are still uniformly distributed over R q × T, since both σ and σ −1 τ are injective maps. On the other hand, the pairs drawn from A q,ψ now follow the Ring-LWE τ distribution A q,ψ τ . Thus, given an algorithm that solves (decision) Ring-LWE τ , it distinguishes in two different sets the m/2 samples drawn from A q,ψ τ and those m/2 uniformly distributed. Since mapping Ring-LWE to Ring-LWE τ instances preserves distributions, the solution for (decision) Ring-LWE problem is done by an identity transformation. Finally, the computation of the transformations σ and σ −1 τ costs O(n 2 ) operations; thus, the reduction runs in polynomial time. This concludes the proof.

Computing the Approximation Factors
Throughout this section, consider an arbitrary number field K of degree n with ring of integers R = O K , and I a fractional ideal in K. Concerning the canonical embedding, a twisted embedding modifies the representatives of a fractional ideal I when seen as a lattice σ τ (I) in H. Thus, since we use lattice measures such as the minimum distance and the successive minima in the security reductions, we analyze the effect of redefining the inner product in the Ring-LWE security reductions.
By strictly following the setting of Lyubashevsky et al. [4], we start by deriving upper bounds for the smoothing parameter concerning the p -norm under twisted embeddings. From the inequalities in (3), we are able to relate the p -norm under twisted embeddings with the infinity norm under the canonical embedding as We can also relate p -norms under both embeddings in H as Using the above inequalities, Lemmas 1 and 2 present upper bounds for the smoothing parameter associated with twisted embeddings, which are a straightforward adaptation of Lemmas 2.7 and 3.5 from [42]. Notice that, when τ = 1, these upper bounds are exactly the same as presented in [42]. Consider that λ (p,τ) n (Λ) and λ (p,τ) 1 (Λ) denotes the k-th successive minimum and the minimum distance of a lattice Λ in the p -norm, respectively, under a τ-twisted embedding. Lemma 1. Let K be an arbitrary number field with fixed field by the involution F and τ ∈ F totally positive. For any p ∈ [2, ∞], any n-dimensional lattice Λ in (K R , ·, · τ ), and any > 0, In particular, for any ω( log n) function, there is a negligible function (n) for which

Lemma 2.
Let K be an arbitrary number field with fixed field by the involution F and τ ∈ F totally positive. For any p ∈ [1, ∞], any n-dimensional lattice Λ in (K R , ·, · τ ), and any > 0, .
In particular, for any ω( log n) function, there is a negligible function (n) such that The (search) Ring-LWE hardness consists in two reductions: (i) a worst-case to average-case reduction from DGS to Ring-LWE (Theorem 3); and (ii) a reduction from the Generalized Independent Vectors Problem (GIVP), which is a generalization of SIVP, to DGS (Lemma 3). (Theorem 4.1)). Let K be an arbitrary number field of degree n with ring of integers R = O K , and I a fractional ideal in K. Let α = α(n) > 0, and let q = q(n) ≥ 2 be such that αq ≥ 2 · ω( log n). For some negligible = (n), there is a probabilistic polynomial-time quantum reduction from K-DGS γ to R-LWE q,Ψ ≤α , where Thus, we use the inequalities for the smoothing parameter η derived in Lemmas 1 and 2 to recompute the approximation factors in Theorem 3 and Lemma 3. We start by computing the approximated factor γ from Theorem 3. As long as α < log n/n, it follows that the K-DGS γ parameter is

Theorem 3 ([4]
Using the inequality η (I) ≤ λ (p,τ) n (Λ) · n 1/2−1/p min i∈[n] τ i · ω( log n) from Lemma 1, we obtain that the parameter ϕ in Lemma 3 is Now, using the above inequality for ϕ, we define the upper bound for the GIVP parameter to be µ, for which

Remark 1.
Notice that, regardless of the p -norm, µ =Õ( √ n/α). SinceÕ( √ n/α) is the approximation factor for the search version of the Ring-LWE problem [4] (Section 4), we conclude that the approximation factors remain unchanged with respect to the change of embeddings due to the asymptotic notation. Moreover, since the twisting factor is constant concerning the number field degree n, the approximation factors for the decision version of the Twisted Ring-LWE problem also remain unchanged.

Applications of the Twisted Ring-LWE
In this section, we discuss how to extend to a more general class of number fields the results of Ducas and Durmus for sampling from a spherical Gaussian distribution [11], focusing on the algebraic realization of Z n -lattices.
Durmus and Ducas proved a special case when a spherical Gaussian distribution with width s in the power basis corresponds to a spherical Gaussian distribution with width s √ m over the space H (Theorem 4) [11]. In order to sample directly over the cyclotomic ring Q[x]/(Φ m (x)), leading to the correct distribution in the embedding representation, they sample the error polynomial in the ring Q . This last equation implies that, if a random variable v ∈ Q[x]/(Θ m (x)) has covariance matrix s 2 Id m , then the covariance matrix of (T −1 • γ)(v) is s 2 E Id m E t = s 2 m Id φ(m) , and the distribution of In the following, we discuss how the shape of spherical Gaussian distributions may be preserved when seen in the space H for special algebraic constructions under twisted embeddings. Following Ducas and Durmus' approach, we are interested in lattices equivalent to Z n , whose Gram matrices have the form c Id n for c ∈ R. In this sense, the matrix mapping elements of K R to the space H is a scaled-orthogonal map [11]. It follows that any algebraic realization of the Z n -lattice preserves the shape of an error distribution over K R when seen as in H.
In Theorem 5, we prove that fractional ideals realizing lattices equivalent to Z n in an orthonormal basis, which are the special case when the Gram matrix is simply Id n , preserve both format and standard deviation of spherical Gaussian distributions. We recall that ideal lattices can be obtained if and only if K is a totally real number field, or if K is a CM-field [36].
Theorem 5. Let K be a number field with an involution and F its associated fixed field. Consider τ ∈ F totally positive and I ⊂ O K a fractional ideal such that I is an ideal lattice in (K R , ·, · τ ). If I is a lattice equivalent to Z n , then both the shape and the standard deviation of a spherical Gaussian distribution in an orthonormal basis of I ⊂ K R are preserved when seen in the canonical basis of the space H (via the twisted embedding σ τ ).
Proof. Let n be the degree of K and let v ∈ I be a random variable over the spherical Gaussian distribution with covariance matrix s 2 Id n in an orthonormal Z-basis of I, for some real number s. Since the twisted embedding σ τ : K R → H is a linear transformation, the covariance matrix of σ τ (v) in the canonical basis of H is Es 2 Id n E t , where E = T −1 M, with T as in (8) and M is the generator matrix of σ τ (I). Since MM t = M t M = Id n , and because MM t is the Gram matrix of the Z n -equivalent lattice I in (K R , ·, · τ ), the covariance matrix of σ τ (v) is which proves that σ τ (v) is randomized in the spherical Gaussian distribution over the canonical basis of H with the same standard deviation as v over K R in the orthonormal basis of I. This concludes the proof.
Examples of ideal lattices equivalent to Z n are those obtained from cyclotomic number fields Q(ζ 2 k ) [36], and their maximal real subfields [37], and the maximal real subfields Q(ζ p + ζ −1 p ) for any prime p ≥ 5 [43]. The case of the power-of-two cyclotomic number fields were previously addressed by Lyubashevsky et al. [4], and Ducas and Durmus [11]. In the following, we discuss the family of lattices equivalent to Z n built on Q(ζ p + ζ −1 p ), for any p ≥ 5 prime.
Let p ≥ 5 be a prime number, n = (p − 1)/2, and ζ = ζ p = exp (−2iπ/p). The cyclotomic construction of the Z n -lattice (Proposition 3) is on the ring of integers of the maximal real subfield of a cyclotomic number field, denoted Q(ζ + ζ −1 ), whose integral basis is
The generator matrix of the Z n -lattice in H = R n (this is an equality because K is totally real), realized in Proposition 3, is given by where D = diag As an immediate consequence of Theorem 5, in Corollary 1 we prove that the construction for the Z n -lattice mentioned above, in fact does not change the shape of the error distribution and, more importantly, the standard deviation is the same when the distribution is seen over H.
p ) for p ≥ 5 prime and let v ∈ O K be a random variable distributed as ψ n s in the basis C . Then, the distribution of (T , seen in the canonical basis of H, is the spherical Gaussian ψ n s .

Proof.
In the realization of the Z n -lattice (Proposition 3), the matrix representing the linear map σ τ from the basis C of O K to the canonical basis of R n is given by M (9). Since O K is a lattice equivalent to Z n in the basis C , the result follows immediately from Theorem 5. This concludes the proof.

Practical Impacts on a Public-Key Cryptosystem
In this section, we use the fact that K = Q(ζ p + ζ −1 p ) is a subfield of Q(ζ p ), for p prime, to analyze the practical impacts of instantiating the Ring-LWE problem over the ring of integers of K in the compact public-key cryptosystem of Lyubashevsky, Peikert, and Regev [12] (Section 8.2).
The public-key cryptosystem presented below is parameterized by an m-th cyclotomic ring R and two coprime integers p and q. The message space is defined as R p and it is required that q be coprime with every odd prime dividing m. Consider that ψ τ is an error distribution over (K R , ·, · τ ) and · denotes a valid discretization to (cosets) of R ∨ or p R ∨ . Also,m = m/2 if m is even, otherwisem = m. Finally, for any a ∈ Z q , let a denote the unique representative a ∈ (a + qZ) ∩ [−q/2, q/2), which is entry-wise extended to polynomials.
• Gen: choose a uniformly random a ∈ R q . Choose x ← ψ τ R ∨ and e ← p · ψ τ p R ∨ . Output (a, b =m(a · x + e) mod qR) ∈ R q × R q as the public key, and x as the secret key.
In such an encryption scheme, the most computationally expensive operations are given by the error sampling and the discretization of the error terms, and the polynomial multiplication. As proved in Corollary 1, when R is the ring of integers of Q(ζ p + ζ −1 p ), the sampling of error terms can be performed directly over (K R , ·, · τ ) in the orthonormal basis C while preserving the spherical format and the standard deviation with respect to the corresponding distribution in H. In this case, the error sampling is similar to that performed when K is a cyclotomic field with dimension a power of two, where the spherical format is preserved but the standard deviation increases by m . Because of that, any algorithm for one-dimensional discrete Gaussian sampling can be used in our instantiation, including those already adopted in the power-of-two cyclotomic case. The efficiency of discrete sampling when K = Q(ζ p + ζ −1 p ) is emphasized by the fact that the discretization in Z n -lattices is simply a coordinate-wise rounding to the nearest integer.
In Ring-LWE cryptosystems, arithmetic operations such as addition and multiplication are performed in the polynomial representation of the ring of integers. The ring of integers of the maximal real subfield Q( p . This would require a change of basis from C , the basis used for error sampling, to the power basis {(ζ p + ζ −1 p ) j | 0 ≤ j < n}. The coefficients of the defining polynomial Ψ p (x) vary according to the choice of p. Aranés and Arenas provided a closed formula for the coefficients of Ψ p υ (x) for p prime and υ ≥ 1 (Theorem 7). Consider that, for strictly positives r and k, A r (k) are the determinants of order k, defined in Theorem 6. For details, we refer the reader to [45]. Theorem 6 ([45] (Theorem 1)). For any strictly positive integers r and k, we have that where ( n k ) denotes the binomial coefficient n! k!(n−k)! .
Notice that, in our case, υ = 1; thus, all coefficients are always non-zero. For example, when p = 31, we have that n = 15 and the defining polynomial Ψ p (x) is which is very dense and the coefficients are not restricted to the set {0, 1}. However, depending on the choice of value for the coefficient's modulus q, the defining polynomial may have a complete factorization modulo q, which allows algorithms based on the Chinese Remainder Theorem (CRT) for efficient polynomial multiplication. For example, for p = 31 and q = 61, the defining polynomial factors in 15 distinct degree-one polynomials as follows:  + 51).
are polynomials of small degree. The multiplication a · b modulo f (x) is done by computing a i = a mod f i (x) and b i = b mod f i (x), for i ∈ [k], computing the component-wise multiplication (a i b i ) and, finally, using the inverse operation to obtain the polynomial c such that c mod f i (x) = a i b i mod f i (x), as discussed by Lyubashevsky and Seiler [27]. Although the asymptotic cost of an algorithm based on this technique is O(n log n), the hidden constants may be large due to the increased number of reductions modulo q in comparison with CRT-based algorithms for power-of-two cyclotomic number fields [27,46]. Another important aspect of the defining polynomial is captured by the expansion factor, a property introduced by Lyubashevsky and Micciancio [47]. The expansion factor of a polynomial f is where g f is the norm of the polynomial g after reduction modulo f . By computing the expansion factor of Ψ p (x), we can measure the increase in magnitude of the maximum coefficient of g Ψ p (x) . Also, the expansion factor helps us in choosing a value for q such that the coefficients do not wrap around after arithmetic operations, avoiding the occurrence of decryption errors. In order to analyze the expansion factor of Ψ p (x), we compare it with x n + 1, the defining polynomial of cyclotomic polynomial rings with dimension a power of two, which is widely adopted in practical applications. For that, we recall Lemma 4, which defines an upper bound for the magnitude of the coefficients of a polynomial g ∈ Z[x] after a reduction modulo f .

Lemma 4. If g is a polynomial in Z[x] and f is a monic polynomial in
For the case f (x) = Ψ p (x), it is sufficient to analyze the value of f ∞ . Firstly, for f (x) = x n + 1, we have that f ∞ = 1. On the other hand, when f (x) = Ψ p (x), f ∞ assumes the maximum value of a j according to Theorem 7. For example, for p = 31, f ∞ = 330, leading to an exponential growth of coefficients, which is roughly 330 deg(g)−deg( f )+1 times bigger with respect to the case when f (x) = x 16 + 1. Such growth of coefficients require an increased value for the choice of the modulus q in order to avoid the coefficients to wrap around after polynomial operations. This also leads to an increase in the length of system parameters and memory/bandwidth requirement for transmission of public parameters.
In the positive direction, since the dimension of K does not increase as a power-of-two, one may want to find a ring instantiation that closely achieves a target security level. For example, to obtain a ring dimension between 700 and 800, the required for achieving 128-bit security [27], possible choices for the value of p ranges from the 223-th to the 252-th prime number, comprehending 29 possible choices.
In a nutshell, we have discussed some practical impacts of instantiating the Twisted Ring-LWE problem when K is the maximal real subfield of a cyclotomic number field, whose dimension is n = (p − 1)/2 for any prime p ≥ 5. The increased cost in arithmetic operations is inherent to this particular instantiation and field representation, but the same cannot be said about all algebraic constructions which lead to lattices equivalent to Z n . This is reinforced by the fact that the ring of integers of power-of-two cyclotomic number fields also leads to lattices equivalent to Z n and, yet, it allows for very efficient algorithms for arithmetic operations in the power basis representation. Thus, in Section 5, we briefly discuss on an alternative field representation when K is the maximal real subfield of a cyclotomic number field. Moreover, we present future research possibilities related to the Twisted Ring-LWE problem.

Discussion
In this paper, we introduce an extension to the Ring-LWE class of problems, namely The Twisted Ring-LWE Problem [4,9]. The Ring-LWE problem uses the canonical embedding to map some underlying ring to a lattice in R n . By doing so, we can define geometric norms and error distributions on the tensor field K R , which is isomorphic to R n . The Twisted Ring-LWE problem is obtained by adopting twisted embeddings [36] rather than the canonical embedding, which is a specialization of twisted embeddings. We prove that the Twisted Ring-LWE Problem is as secure as the original Ring-LWE Problem by providing a security reduction from both variants of Ring-LWE to their twisted forms.
As a result, we broaden the scope of number of algebraic lattices that can be used for lattice-based cryptosystems, including those algebraic constructions of lattices that allow additional factors on the embedding coordinates. This type of construction has been useful in coding theory, since they allow the construction of algebraic lattices with improved properties for Rayleigh fading channels, providing high density, maximum diversity, and great minimum product distance [33][34][35]. Notice that these constructions cannot be obtained via canonical embedding. We took as an example the construction of rotated Z n -lattices. We prove that we can perform efficient and secure sampling from spherical Gaussian distributions in K R , if the parameter ring leads to a rotated Z n -lattice in the space H via twisted embeddings. This generalizes the results of Ducas and Durmus in Theorem 5 [11] and the power-of-two cyclotomic case.
An example of a construction of the Z n -lattice via twisted embeddings is from maximal real subfields of both power-of-two and p-th cyclotomic number fields. We analyze instantiating the Ring-LWE problem using maximal real subfields of p-th cyclotomic number fields in a public-key encryption scheme [12]. By doing so, we can instantiate the Ring-LWE problem in a dimension close to 700 to achieve 128-bit security [25] and provide variability of security assumptions, avoiding the use of the widely adopted power-of-two cyclotomic number field. However, representing the field elements as residue polynomials modulo the defining polynomial is of limited interest, since the coefficients' modulus may become very large to avoid the occurrence of decryption errors. This occurs because the expansion factor of the defining polynomial of maximal real subfields of p-th cyclotomic number fields grows exponentially.

Future Work
Lyubashevsky, Peikert, and Regev [12] suggested representing the field elements as coefficient vectors in an integral basis apart from the power basis. By taking the underlying ring as the ring of integers of the maximal real subfield of a cyclotomic number field on an orthonormal basis, we can perform efficient Gaussian sampling with hardness guarantee, as discussed in Section 4. Moreover, we can perform efficient ring arithmetic by taking the ring representatives under the twisted embedding, in which both addition and multiplication are taken component-wise. Although the change of representation may need floating-point arithmetic, one may explore lattice basis symmetries to accelerate the computation of the twisted embedding or find a basis more suitable for arithmetic operations. In addition to that, all algorithmic tasks can be performed directly in the space H, without resorting to change of representation from K R . We leave as future work a full analysis and the software implementation of the instantiation of the Twisted Ring-LWE Problem in a cryptosystem adopting the coefficient vector representation.
We also leave as future work detailing how to connect Twisted Ring-LWE instantiations over different number fields, if the ring of integers of both number fields leads to equivalent lattices under twisted embeddings. By doing so, we can connect an instance on a power-of-two cyclotomic number field to an instance of a maximal real subfield as both rings of integers lead to a construction of the Z n -lattice. This may lead to a response to the open question left by Peikert, Regev, and Stephens-Davidowitz [9]. As a consequence, we may be able to explore algebraic properties inherent to maximal real subfields helping to assert the concrete hardness of power-of-two cyclotomic number fields.